#设置debug项目名后缀
set(CMAKE_DEBUG_POSTFIX "_gd")
#引用当前文件夹
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)

#设置预处理
add_definitions(-DTIXML_USE_STL)
set(TINYXML_SRC 
	tinystr.cpp 
	tinyxml.cpp 
	tinyxmlerror.cpp
	tinyxmlparser.cpp)
	
set(TINYXML_HDR
	tinystr.h
	tinyxml.h)

add_library(commonLibTinyXml STATIC ${TINYXML_SRC} ${TINYXML_HDR})

#设置预编译
SET_TARGET_PROPERTIES(commonLibTinyXml PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h")
cotire(commonLibTinyXml)

#设置目录
set_target_properties(commonLibTinyXml PROPERTIES FOLDER "CommonLib")

#复制头文件到inchhvi
install(FILES ${TINYXML_HDR} DESTINATION ${PROJECT_SOURCE_DIR}/3rdlib/include/tinyxml)

install(TARGETS commonLibTinyXml 
        RUNTIME DESTINATION ${PROJECT_BINARY_DIR}/bin
		ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR}/3rdlib/lib)